﻿using System;
using DuckFlyWithInterface;

namespace DuckFlyWithInterfaceTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Duck duck1 = new Shelduck();
            Duck duck2 = new RedheadDuck();
            Duck duck3 = new RobberDuck();

            Console.WriteLine("=== 初始行为 ===");
            duck1.Display();
            duck1.PerformFly();
            duck1.PerformQuack();
            duck1.PerformSwim();

            Console.WriteLine();

            duck2.Display();
            duck2.PerformFly();
            duck2.PerformQuack();
            duck2.PerformSwim();

            Console.WriteLine();

            duck3.Display();
            duck3.PerformFly();
            duck3.PerformQuack();
            duck3.PerformSwim();

            Console.WriteLine("\n=== 改变行为后 ===");
            duck3.ChangeFlyBehavior(new FlyWithRocket());
            duck3.ChangeQuackBehavior(new NormalQuack());
            duck3.ChangeSwimBehavior(new NormalSwim());

            duck3.Display();
            duck3.PerformFly();
            duck3.PerformQuack();
            duck3.PerformSwim();

            Console.ReadKey();
        }
    }
}